/*
 * Eugen Stoian <stoian.e@gmail.com> 2010
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef POINT_H
#define POINT_H

class Point
{
public:
    Point(double x = 0.0, double y = 0.0, double z = 0.0, double w = 1.0);
    Point(const Point& p);
    Point& operator=(const Point& p);

    double operator[](int i) const {
        return _data[i];
    }
    double& operator[](int i){
        return _data[i];
    }

    double x() const {
        return _data[0];
    }
    double& x() {
        return _data[0];
    }

    double y() const {
        return _data[1];
    }
    double& y() {
        return _data[1];
    }

    double z() const {
        return _data[2];
    }
    double& z() {
        return _data[2];
    }

    double w() const {
        return _data[3];
    }
    double& w() {
        return _data[3];
    }
    bool isValid() const;
    bool isFinite() const;
    double parameterValue() const;
    void setParameterValue(double t);
    bool operator==(const Point& point) const;
    bool operator!=(const Point& point) const;
protected:
    double _data[4];
    double _parameterValue;
};

#endif // POINT_H
